//
//  AutoreleasePool.hpp
//  Simulation
//
//  Created by Christopher Kemsley on 3/4/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#ifndef Simulation_AutoreleasePool_hpp
#define Simulation_AutoreleasePool_hpp

#include "Object.hpp"
#include <vector>



NamespaceBegin

class	RunLoop ;




class	AutoreleasePool
{
public:
	
	static AutoreleasePool&	current () ;
	
	void	autorelease	( Object * inObject ) ;
	
	
	
private:
	std::vector<Object*>	mPool ;
	
	AutoreleasePool () ;
	~AutoreleasePool () ;
	
protected:
	
	friend class RunLoop ;
	
	void	drain () ;
} ;




NamespaceEnd

#endif
